<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{$school['title']}</title>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width initial-scale=1.0 maximum-scale=1.0 user-scalable=yes" />
<link type="text/css" rel="stylesheet" href="{OSSURL}public/mobile/css/mMessageContent.css?v=4.8" />
<link type="text/css" rel="stylesheet" href="{OSSURL}public/mobile/css/greenStyle.css?v=4.80120" />
<script type="text/javascript" src="{MODULE_URL}public/mobile/js/jquery-1.11.3.min.js?v=4.8"></script>
</head>
<body>
<div class="all">
<div id="BlackBg" class="BlackBg"></div>
<div id="titlebar" class="header mainColor">
	<div class="l"><a class="backOff" style="background:url({OSSURL}public/mobile/img/ic_arrow_left_48px_white.svg) no-repeat;background-size: 55% 55%;background-position: 50%;" href="javascript:history.go(-1);"></a></div>
	<div class="m">
		<span style="font-size: 18px">消息详情</span>   
	</div>
		<div class="r">
			<a href="#my-menu"></a>
		</div>
	</div>
<div id="titlebar_bg" class="_header"></div>
		<div class="messageItem">
			<div class="msgPic">
				<div class="avatar">
					<img src="{php echo toimage($member['avatar'])}" alt="">
				</div>
			</div>
			<div class="msgBody">
				<div class="msgTitle">{$bjname}|{$student['s_name']}的请假申请</div>
				<div class="msgSender l">{$leave['type']}</div>
				<div class="msgTime l">请假时间段：{$leave['startime']}至{$leave['endtime']}</div>
			</div>
					<input id="photostr" type="hidden" value="" />
					<div id="msgContent" class="msgContent">
						<a style = "color:red">请假原因</a>：&nbsp; {$leave['conet']}
					</div>
		</div>
        
		{if $isbzr['id'] == $bzrtid}
		<div class="msgbtn">
			    {if $leave['status'] == 0}
				<div class="div-reply" onclick="agree();">
					<div class="btn-replay">同意申请</div>
				</div>
				
				<div class="div-tel">
					<div class="btn-tel" onclick="defeid();">
						<div class="btn-tell">拒绝申请</div>
					</div>
				</div>
				{else if $leave['status'] == 1}
				<div class="div-reply">
					<div class="btn-replay">已同意</div>
				</div>
				<div class="div-tel">
				</div>	
                {else if $leave['status'] == 2}	
				<div class="div-reply">
					
				</div>
				<div class="div-tel">
					<div class="btn-tel">
						<div class="btn-tell">已拒绝</div>
					</div>
				</div>				
				{/if}
				
				
		</div>
		{/if}
		
		<div class="blank"></div>
		<!-- 回复消息 start -->
		<div id="replyMessage">
			<div id="replyTips" class="mainfont tips"><font style="font-size:16px;"></font>审批结果</div>
			 {if $leave['cltime'] != 0} 
			  <ul id="infoList">
			     <li class="replyItem replyItemborder">
			          <div class="msgPic l">
			                <div class="avatar">
			                      <img src="{php echo toimage($isbzr['thumb'])}" alt=""></div>
			          </div>
			          <div class="msgBody">
			          <div class="msgTop">
			                <div class="replyName l">{$isbzr['tname']}</div>
			                <div class="msgTime r">{if !empty($leave['cltime'])}{php echo (date('m-d H:m',$leave['cltime']))}{/if}</div>
			          </div>
			                <div class="replyContent">{if $leave['status'] == 0}未读{else if $leave['status'] == 1}同意请假{else if $leave['status'] == 2}不同意{/if}</div>
			          </div>
			     </li>	
			   </ul>
			  {/if}
		</div>
		<!-- 回复消息 end -->
	</div>
 {php include $this->template('footer');} 	
</body>
<!-- 提示框 -->
<script type="text/javascript" src="{OSSURL}public/mobile/js/PromptBoxUtil.js?v=4.81022"></script>
<script type="text/javascript">
var PB = new PromptBox();

function agree(){

	if(confirm("确认同意请假申请？")){
		var submitData = {
			openid :"{$openid}",
			schoolid :"{$schoolid}",
			weid :"{$weid}",
			id :"{$leaveid}",
			tname :"{$isbzr['tname']}",
		};
	        $.post("{php echo $this->createMobileUrl('indexajax',array('op'=>'sagree'))}",submitData,function(data){
            if(data.result){
                PB.prompt(data.msg);
				location.reload();
            }else{
                PB.prompt(data.msg);
            }
        },'json'); 
    }
}

function defeid(){

	if(confirm("确认拒绝请假申请？")){
		var submitData = {
			openid :"{$openid}",
			schoolid :"{$schoolid}",
			weid :"{$weid}",
			id :"{$leaveid}",
			tname :"{$isbzr['tname']}",
		};
	        $.post("{php echo $this->createMobileUrl('indexajax',array('op'=>'sdefeid'))}",submitData,function(data){
            if(data.result){
                PB.prompt(data.msg);
				location.reload();
            }else{
                PB.prompt(data.msg);
            }
        },'json'); 
    }
}
</script>
</html>